﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Management;
using System.Text;
using WMI.NET.Abstracts;
using WMI.NET.CIM;

namespace WMI.NET.ComputerSystemHardware.CoolingDevice
{
    /// <summary>
    /// The Win32_TemperatureProbe  WMI class represents the properties of a temperature sensor (electronic thermometer).
    /// Most of the information that the Win32_TemperatureProbe WMI class provides comes from SMBIOS. Real-time readings for the CurrentReading property cannot be extracted from SMBIOS tables. For this reason, current implementations of WMI do not populate the CurrentReading property. The CurrentReading property's presence is reserved for future use. 
    /// </summary>
    public class Win32_TemperatureProbe : CIM_TemperatureSensor
    {
        
        /// <summary>
        /// 
        /// </summary>
        /// <param name="mbo"></param>
        public Win32_TemperatureProbe(ManagementBaseObject mbo)
            : base(mbo)
        {

        }

    }

    /// <summary>
    /// 
    /// </summary>
    public class GetWin32_TemperatureProbes : Win32Collection<Win32_TemperatureProbe>
    {

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public override ReadOnlyCollection<Win32_TemperatureProbe> GetCollection()
        {
            List<Win32_TemperatureProbe> tempCollection = new List<Win32_TemperatureProbe>();

            foreach (var s in searcher.Get())
            {
                Win32_TemperatureProbe tempListItem = new Win32_TemperatureProbe(s);
                tempCollection.Add(tempListItem);
            }

            return tempCollection.AsReadOnly();
        }

        /// <summary>
        /// 
        /// </summary>
        public GetWin32_TemperatureProbes() : base("SELECT * FROM Win32_TemperatureProbe") { }

    }
}
